/-app
/-docs
/-files
FileTree.ts
SyncStorageAccess.ts
/-fs
/-fs/attached
/-imports
/-persistence ...
Drive.ts
/-storage
/-typings
errors.js
functions.ts
index.html
try.js
x
      detect(uniqueId: string, callback: (detached: Detached) => void ): void;
 
25
        op.detect(
26
          uniqueKey,
27
          detached => {
28
            if (!detached) {
29
              driveIndex++;
30
              loadNextOptional();
31
              if (detached.timestamp > domTimestamp) {
32
                detached.apply(dom, loadedDrive => {
33
                  this._mirror = loadedDrive;
34
                  loaded();
35
                });
36
              }
37
              else {
38
                detached.purge(loadedDrive => {
39
                  this._mirror = loadedDrive;
40
                  loaded();
41
                });
42
              }
43
            }
44
          });
45
      };
46
    
47
      loadNextOptional();
48
    }
49
    
50
    files(): string[] {
51
      return this._dom.files();
52
    }
53
​
54
    read(file: string): string {
55
      return this._dom.read(file);
56
    }
57
​
58
    write(file: string, content: string) {
59
      this._dom.write(file, content);
60
      if (this._mirror)
61
        this._mirror.write(file, content);
62
    }
63
    
64
  }
65
  
66
  export module Drive {
67
    
68
    export interface Mirror {
69
      
70
      write(file: string, content: string);
71
      
72
    }
73
    
74
    export interface Optional {
75
      
60:42